package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.BusinessMapper;
import com.foreknow.elmboot.po.Business;
import com.foreknow.elmboot.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service

public class BusinessServiceImpl implements BusinessService {
    @Autowired
    private BusinessMapper businessMapper;
    @Override
    public List<Business> listBusinessByTypeId(Integer orderTypeId) {
        List<Business> objects = new ArrayList<>();

        try {
            objects=businessMapper.listBusinessByTypeId(orderTypeId);
            return objects;
        } catch (Exception e) {
            e.printStackTrace();
        }
return objects;

    }
    @Override
    public Business getBusinessById(Integer businessId) {
        Business objects1 = new Business();

        try {
            objects1=businessMapper.getBusinessById(businessId);
            return objects1;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return objects1;
    }
}
